package com.aixx.springcloud.alibaba.controller;

import com.aixx.springcloud.alibaba.domain.CommonResult;
import com.aixx.springcloud.alibaba.service.StorageService;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shkstart
 * @create 2021-02-18 11:16
 */
@RestController
public class StorageController {


    @Autowired
    private StorageService storageService;
    @PostMapping("/storage/decrease")
   public CommonResult decrease(@RequestParam("productId") Long productId, @RequestParam("count") Integer count){

       storageService.decrease(productId,count);
        return new CommonResult(200,"库存修改成功");
    }


}


